package com.csii.mca.workflow;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.csii.pe.core.Context;
import com.csii.pe.dynamic.jnl.JNLState;
import com.csii.pe.dynamic.service.RequestContext;
import com.csii.pe.dynamic.service.ResponseContext;
import com.csii.pe.dynamic.taskmodel.TaskState;
import com.csii.pe.dynamic.workflow.TaskEntranceTemplate;
import com.csii.pe.dynamic.workflow.TaskEntryTemplate;

@SuppressWarnings("unused")
public class MCATaskEntranceTemplate extends TaskEntranceTemplate {
        private static final Log logger=LogFactory.getLog(MCATaskEntranceTemplate.class);

        
        @Override
        protected void beforeSubmit(RequestContext requestContext, Object request,
                        Context context, ResponseContext responseContext) {
        }
        
        @Override
        protected void finalHandle(RequestContext requestContext, Object request,
                        Context context, ResponseContext responseContext) {
                JNLState jnlState = JNLState.resolveJNLState(responseContext);
        }

        @Override
        protected void precheck(RequestContext requestContext, Object request,
                        Context context, ResponseContext responseContext) {
                // 是否临柜授权
                if (this.taskModel != null) {
                        TaskState taskState = this.taskModel.checkTaskState(request,requestContext);
                        if (taskState != null) {
                                responseContext.setLocalProcessFlag(!taskState
                                                .isRemoteProcessFlag());
                        }
                }
        }

}
